In [1]:
import quimb as qu

H = qu.ham_heis(12)

In [2]:
%%timeit
el, ev = qu.eigh(H)


8.81 s ± 566 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

This is already quite slow, and will not be sustainable for larger lengths. The Heisenberg Hamiltonian however has an abelian $Z_2$ subgroup symmetry, conserved Z-spin, that manifests itself in the computational basis. Thus if instead we specify autoblock=True:


In [3]:
%%timeit
el, ev = qu.eigh(H, autoblock=True)


372 ms ± 192 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)

In [4]:
psi = qu.eigvecsh(H, k=1, which='sa')